﻿@{
    ViewBag.Title = "Withdraw";
    Layout = "~/Views/Shared/_Member.cshtml";
}
<div class="container" style="margin-top: 20px;">
    <div class="headline">
        <h2>
            余额提现</h2>
    </div>
    <div class="tag-box tag-box-v3">
        <div class="row-fluid">
            <div class="span12" style="height: 46px; line-height: 46px; border-bottom: 1px solid #eee;">
                @{
                    RooHui.Infrastructure.Entities.Entity.Account account = ViewBag.Account;
                }
                <h2>
                    账号余额： <span class="orange" style="font-size: 24px; font-weight: bold;">@account.BalanceAmount</span>
                    &nbsp;&nbsp;&nbsp;冻结余额： <span class="blue" style="font-size: 24px; font-weight: bold;">
                        @account.FrozenAmount</span>
                </h2>
            </div>
        </div>
        <div class="row-fluid">
            <div class="span12" style="margin-left: 0; height: 46px; line-height: 46px;">
                <div class="span12">
                    提示：</div>
            </div>
        </div>
        <div class="row-fluid">
            <div class="span12">
                <ul>
                    <li>身份认证、账户托管开通、提现银行设置均成功后，才能进行提现操作；</li>
                    <li class="text-error">提现费用为每笔2元；</li>
                    <li>因@(RooHui.Infrastructure.Configuration.SiteSettings.SiteName)无法触及用户资金账户，无法收取用户任何费用，为防止套现，所充资金必须经投标回款后才能提现；</li>
                    <li>资金到达用户账户的当日（包括周六/周日/法定节假日）即可发起提现申请；</li>
                    <li>工作日（周六/周日/法定节假日均除外）21:00之前申请的提现，当日审核完毕并预计于下一工作日12:00-16:00到账，<br />
                        否则将于下一工作日审核并预计于再下一工作日12:00-16:00到账，实际到账时间依据账户托管方（第三方支付平台）及提现银行而有所差异。</li>
                </ul>
            </div>
        </div>
        <hr />
        @if (!String.IsNullOrEmpty(ViewBag.Message))
        { 
        <div class="alert alert-error">@ViewBag.Message</div>
        }
        <form id="form1" action="/member/withdraw" method="post" class="form-horizontal">
        <input type="hidden" name="token" />
        <div class="control-group">
            <label class="control-label" for="inputEmail">
                真实姓名</label>
            <div class="controls">
                <input type="text" readonly="readonly" id="txtrealname" value="郭鹏" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inputPassword">
                可用余额</label>
            <div class="controls">
                <input type="text" readonly="readonly" id="txtamount" value="@account.BalanceAmount" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label" for="inputPassword">
                提现金额</label>
            <div class="controls">
                <input type="text" id="txtwithdraw" name="amount" value="@ViewBag.Amount" class="{required:true,number:true,min:0.01,max:@account.BalanceAmount,messages:{required:'请输入提现金额',number:'金额输入有误',min:'请输入大于0.01的整数或小数',max:'您的余额不足'}}" />
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">
                验证码</label>
            <div class="controls">
                <input type="text" name="validationCode" class="input-small {required:true,length:4,messages:{required:'请输入验证码'}}" />
                <div id="codeimg" style="margin-left: 10px; display: inline;"></div>
            </div>
        </div>
        <div class="control-group">
            <div class="controls">
                <button type="submit" class="btn-u">
                    确定</button>
            </div>
        </div>
        </form>
    </div>
</div>
@section scripts{
    <script type="text/javascript" src="/content/plugins/jquery-validate/jquery.validate.js"></script>
    <script type="text/javascript" src="/content/plugins/jquery-validate/jquery.metadata.js"></script>
    <script type="text/javascript" src="/content/scripts/plug.js"></script>
     <script type="text/javascript">
         var validation = new plug.BindValidCode();
         $(function () {
             validation.BindValidator();
             $('#form1').validate({
                 errorClass: "help-inline",
                 errorElement: "span",
                 highlight: function (element, errorClass, validClass) {
                     $(element).parents('.control-group').addClass('error');
                 },
                 unhighlight: function (element, errorClass, validClass) {
                     $(element).parents('.control-group').removeClass('error');
                 }
             });
         });
         function Refalsh(sender) {
             validation.Refalsh(sender);
         }
    </script>
}